#ifndef BASE_BASElOG_H
#define BASE_BASElOG_H

#include "type.hpp"

extern void db_printf(level_t level, const char *file, int line, const char* func, const char *fmt, ...);
extern level_t LEVEL_INFO;
extern level_t LEVEL_WARN;
extern level_t LEVEL_ERROR;
extern level_t LEVEL_DEBUG;

#define info(...) db_printf(LEVEL_INFO, __FILE__, __LINE__, __func__, __VA_ARGS__)
#define warn(...) db_printf(LEVEL_WARN,  __FILE__, __LINE__, __func__, __VA_ARGS__)
#define error(...) db_printf(LEVEL_ERROR,  __FILE__, __LINE__, __func__, __VA_ARGS__)
#define debug(...) db_printf(LEVEL_DEBUG,  __FILE__, __LINE__, __func__, __VA_ARGS__)

#endif // !BASE_BASElOG_H